﻿//**********************************************************************//
// Author:       NickWang (nick_1213@foxmail.com)                       
// CreateTime:   2018-07-01 13:54:06     
// Explain:      订单信息                            
//**********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WeChatParking.Entity
{
    /// <summary>
    /// 订单信息
    /// </summary>
    public class Order_info : SimpleEntity
    {
        /// <summary>
        /// 订单id
        /// </summary>
        public String order_id { get; set; }
        /// <summary>
        /// 外部订单id
        /// </summary>
        public String outer_order_id { get; set; }
        /// <summary>
        /// 微信用户id
        /// </summary>
        public Int32 Wxuser_id { get; set; }
        /// <summary>
        /// 充值姓名
        /// </summary>
        public String Wxuser_name { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        public String car_no { get; set; }
        /// <summary>
        /// 车场对应的物业ID
        /// </summary>
        public int EnterpriseID { get; set; }
        /// <summary>
        /// 车场对应ID
        /// </summary>
        public int CCEnterpriseID { get; set; }
        /// <summary>
        /// 订单总金额。=优惠金额+应付金额
        /// </summary>
        public Decimal total_fee { get; set; }
        /// <summary>
        /// 优惠金额
        /// </summary>
        public Decimal discount_fee { get; set; }
        /// <summary>
        /// 应付金额
        /// </summary>
        public Decimal real_fee { get; set; }
        /// <summary>
        /// 实付金额
        /// </summary>
        public Decimal pay_fee { get; set; }
        /// <summary>
        /// 支付类型。 5-云闪付，6-微信，7-支付宝，8-微信（通联）,9-现金
        /// </summary>
        public Int16 pay_type { get; set; }
        /// <summary>
        /// 支付状态。1-未支付，2-部分支付，3-支付完毕,4-退款完成
        /// </summary>
        public Int16 pay_status { get; set; }
        /// <summary>
        /// 订单状态。1-未支付，2-进行中，3-已完成，4-已失效，5-已取消'
        /// </summary>
        public Int16 order_status { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? pay_time { get; set; }
        /// <summary>
        /// 支付备注
        /// </summary>
        public String pay_note { get; set; }
        /// <summary>
        /// 优惠备注
        /// </summary>
        public String discount_note { get; set; }
        /// <summary>
        /// 订单备注
        /// </summary>
        public String order_note { get; set; }
        /// <summary>
        /// 支付数据
        /// </summary>
        public String pay_data { get; set; }
        /// <summary>
        /// 拉取时间
        /// </summary>
        public DateTime? pool_time { get; set; }
        public string Guid { get; set; }
        public string GetPayTypeName()
        {
            if (this.pay_type == (short)Enums.PayType.Weixin)
                return "微信支付";
            if (this.pay_type == (short)Enums.PayType.Alipay)
                return "支付宝";
            if (this.pay_type == (short)Enums.PayType.Tonglian)
                return "微信支付（通联）";
            if (this.pay_type == (short)Enums.PayType.UnionPay)
                return "云闪付";
            if (this.pay_type == (short)Enums.PayType.XJPay)
                return "现金支付";
            return string.Empty;
        }
    }
}

